<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>js 转换</title>
		<script>
			var s=prompt("请输入一个数字：");
			if(!isNaN(s)){
				var k=parseInt(s);
				alert(k);
			}else{
				alert("不能转换成数字");
			}
			
		</script>
	</head>
	<body>
	</body>
</html>